package com.wl.zlmanage.utils;

import com.wl.zlmanage.constant.ActivityConstant;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConfigurationUtil {

    final static private Logger logger = LoggerFactory.getLogger(ConfigurationUtil.class);

    protected static final Properties param = new Properties();

    static {
        InputStream in =
            ConfigurationUtil.class.getClassLoader()
                .getResourceAsStream(ActivityConstant.CONFIG_PROPERTIES_FILE);
        try {
            param.load(in);
        } catch (IOException e) {
            logger.error("加载配置文件失败:", e);
            System.exit(-1);
        }
    }

    public static String get(String key) {
        return param.getProperty(key, null);
    }


}
